#!/usr/bin/python
# -*- coding:UTF8 -*-


testdata = {
    "testtitle": "用户登录",
    "teststep": "输入用户名和密码"
}
print(testdata.items())


# for k, v in testdata.items():
#     print(k, v)


# **kwargs 参数
def f(**kwargs):
    word = ''
    for k, v in testdata.items():
        word = word + str(v) + '|'
    print(word)


f(id=1, title='用户登录', teststep="用户名，密码")


def auto_generate_case(testtitle, teststep, *testdata):
    print('编号|测试标题|测试步骤|测试数据')
    for i in range(len(testdata)):
        print(f'{i + 1}|{testtitle}|{teststep}|{testdata[i]}')


auto_generate_case('用户登录', '输入用户名，密码', 'test1,123456', ',', ',123456')

# 打印出1-100 之间的奇数
for i in range(1, 101, 2):
    print(i)
# 打印1+2+3+4...+100 之和
sum = 0
for i in range(1, 101):
    sum = sum + i
print(sum)
#
# 嵌套循环
# 可以在for循环中再次添加循环。
for x in range(2):
    for y in range(2):
        print(x, y)
# 打印出 九九乘法表
# 方法一
for i in range(1, 10):
    for j in range(i, 10):
        if j == 9:
            # print(i, '*', j, '=', i * j)
            # 改进，用占位符
            print('{} * {} = {}'.format(i, j, i * j))
        else:
            # print(i, '*', j, '=', i * j, end='\t')
            # 改进，用占位符
            print('{} * {} = {}'.format(i, j, i * j), end='\t')
print('------------------------------------------')

# 方法二
for x in range(1, 10):
    for y in range(1, x + 1):
        if x <= y:
            # print(x, "*", x, "=", x * y)
            # 改进，用占位符
            print(f'{x} * {y} = {x * y}')
        else:
            # print(x, "*", x, "=", x * y, end='\t')
            # 改进，用占位符
            print(f'{x} * {y} = {x * y}', end='\t')

students = ['xiaohei', 'Xiaoliu', 'xiaozu', 'Xiaowang']
A = []
B = []
for i in students:
    # name = students[i]
    first_str = i[0]
    print(first_str)
    if first_str.isupper():
        A.append(i)
    else:
        B.append(i)
print(B)
